{% extends "base.html" %}

{% block title %}{{ article.Title }} | Nickcheng.LOG{% endblock %}

{% block main %}
    <div id="single">
        <div class="postmetadata">
            <h3>{{ article.Title }}</h3>
            <h4 class="articleDate">{{ article.PostDate }}</h4>
        </div>
        <div id="postentry">
            {{ article.Content }}
        </div>
        <div id="comments">
            {% if article.CommentCount %}
                <h4>{{ article.CommentCount }} 条评论</h4>
                <ul id="commentList">
                    {% for item in comments %}
                        <li class="comment" id="comment-{{ item.ID }}">
                            <cite>
                                {% if item.AuthorURL %}
                                    <a href="{{ item.AuthorURL }}">{{ item.Author }}</a>
                                {% else %}
                                    {{ item.Author }}
                                {% endif %}
                            </cite> 
                            说道:
                            <div>
                                {{ item.Content }}
                            </div>
                            <h4 class="articleDate">彼时: <a href="{{ article.URL }}#comments-{{ item.ID }}">{{ item.PostDate }}</a></h4>
                        </li>
                    {% endfor %}
                </ul>
            {% endif %}
            {% if inputError %}
                <h4 class="errorInfo">输入有误</h4>
            {% endif %}
            <h4>请发表评论</h4>
            <div id="commentForm">
                <form method="post" action=".">
                    <p>
                        <input type="text" name="author" id="author" tabindex="1" />
                        <label><small>尊姓大名(不能不写哦)</small></label>
                    </p>
                    <p>
                        <input type="text" name="email" id="email" tabindex="2" />
                        <label><small>您的电子邮件(绝不会公开, 但不能不写)</small></label>
                    </p>
                    <p>
                        <input type="text" name="url" id="url" tabindex="3" />
                        <label><small>你的Blog或网站地址</small></label>
                    </p>
                    <p>
                        <textarea name="comment" id="comment" tabindex="4" cols="100%" rows="7"></textarea>
                    </p>
                    <p>
                        <input type="submit" name="submit" id="submit" tabindex="5" value="发表评论" />
                    </p>
                </form>
            </div>
        </div>
    </div>
{% endblock %}
